﻿<%
Class checkAction
	
	'''构造
	Private Sub Class_Initialize()
	End Sub
	
	'''析构
	Private Sub Class_Terminate()
	End Sub
	
	'''默认检测
	Public Sub [Default]()
		If Session("adminid") = "" Then
			Response.Redirect("/?g=admin&m=index&a=index")
		End If
		'''加入db
		Sa.Use("Db")
		Db.Conn = Db.OpenConn(1,Sa.Config("AccessPath"),Sa.Config("AccessPwd"))
	End Sub

	
	'''显示300信息
	'p_s:提示信息
	Public Sub W300(Byval p_s)
		Response.Write("{""statusCode"":300,""message"":""" & p_s & """,""navTabId"":"""",""rel"":"""",""callbackType"":"""",""forwardUrl"":"""",""confirmMsg"":""""}")
	End Sub
	
	'''显示300信息，并中断
	Public Sub WE300(Byval p_s)
		W300(p_s)
		Response.End()
	End Sub
	
	'''显示200信息
	'p_s:提示信息
	'p_t:navTabId
	Public Sub W200(Byval p_s, Byval p_t)
		Response.Write("{""statusCode"":200,""message"":""" & p_s & """,""navTabId"":""" & p_t & """,""rel"":"""",""callbackType"":"""",""forwardUrl"":"""",""confirmMsg"":""""}")
	End Sub
	
	'''Ajax检测
	Public Sub ForAjax()
		'直接访问非法
		If Request.ServerVariables("HTTP_REFERER")="" Then
			Response.Redirect("/?g=admin&m=index&a=index")
			Response.End()
		End If
		If Session("adminid") = "" Then
			Response.Write("{""statusCode"":301,""message"":""登录超时,请重新登录"",""navTabId"":"""",""callbackType"":"""",""forwardUrl"":""""}")
			Response.End()
		End If
		Sa.Use("Db")
		Db.Conn = Db.OpenConn(1,Sa.Config("AccessPath"),Sa.Config("AccessPwd"))
	End Sub
	
	'''后台使用分页
	Public Sub UsePager()
		Sa.Use("Pager")
		Pager.PageVar = "pageNum"
		Pager.PageSize = P("numPerPage:n:10")
		Call Pager.AddPara("g", "admin")
		Call Pager.AddPara("m", G("m:s:" & C_DefModule))
		Call Pager.AddPara("a", G("a:s:" & C_DefAction))
	End Sub
End Class
%>